package com.bw.demoseckill.controller;



import com.bw.demoseckill.service.GoodsService;
import com.bw.demoseckill.service.UserService;
import com.bw.demoseckill.utils.ResponseResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author Administrator
 */
@RestController
@RequestMapping("user")
@Slf4j
@CrossOrigin
public class UserController {

    @Autowired
    private UserService userService;

    @Autowired
    private GoodsService goodsService;


    /**
     * TODO 用户登录
     * @return
     */
    @PostMapping("doUserLogin")
    public ResponseResult doUserLogin(String userName, String userPwd){
        return userService.doUserLogin(userName,userPwd);
    }

    @PostMapping("goodsList")
    public ResponseResult goodsList(){
        return goodsService.goodsList();
    }


}
